package routes

import (
	"earth/handlers"

	"github.com/gin-gonic/gin"
)

func Register(app *gin.Engine) *gin.Engine {
	v1 := app.Group("/api/v1")
	// #################用户路由###################
	{
		userGroup := v1.Group("user")
		{
			user := new(handlers.UserHandler)
			userGroup.GET("/:id", user.GetUserByID)
			userGroup.GET("/", user.GetAllUsers)
		}
	}
	// ################政策路由#####################
	{
		policyGroup := v1.Group("policy")
		{
			policy := new(handlers.PolicyHandler)
			policyGroup.GET("/", policy.GetAllPolicies)
		}
	}
	return app
}
